<!--suppress ALL -->
<div class="layui-fluid layui-anim website-anim" id="website-result" lay-title="课题征集管理"
     xmlns:th="http://www.w3.org/1999/xhtml">
    <div class="layui-row website-container">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body website-table-full">
                    <div class="layui-inline">
                        <label class="layui-form-label" th:text="'总分: '+ ${score==null?'-':score}"></label>
                    </div>
                    <table lay-filter="resultTable" lay-data="{id: 'resultTable'}"></table>
                </div>
            </div>
        </div>
    </div>
</div>

<script data-th-inline="javascript" type="text/javascript">
    layui.use(['jquery', 'table', 'website'], function () {
        var $ = layui.jquery,
            website = layui.website,
            form = layui.form,
            table = layui.table,
            $view = $('#website-result'),
            declareTopicId = [[${declareTopicId}]],
            planId = [[${planId}]],
            tableIns;

        var column = [
            {type: 'numbers', title: '序号',},
            {
                title: '指标', minWidth: 100, templet: function (d) {
                    var text = d.indicatorName;
                    if (d.indicatorDescription) {
                        text += "-" + d.indicatorDescription
                    }
                    return text;
                }
            },
            {field: 'weight', title: '权重', minWidth: 100},

        ];
        getColumn();

        //获取列
        function getColumn() {
            website.get(ctx + 'biz/evaluation/review/column/' + declareTopicId + "/" + planId, null, function (data) {
                for (expert of data.data) {
                    var item = {};
                    item.field = expert.expertId
                    item.title = expert.name
                    column.push(item);
                }
                initTable();
            });
        }

        /**
         * 初始化表格
         */
        function initTable() {
            tableIns = website.table.init({
                elem: $view.find('table'),
                id: 'resultTable',
                limit: Number.MAX_VALUE,// 数据表格默认全部显示
                page: false,
                url: ctx + 'biz/evaluation/review/' + declareTopicId + "/" + planId,
                /*parseData: function (res) { //res 即为原始返回的数据
                    /!*  return {
                          "code": res.status, //解析接口状态
                          "msg": res.message, //解析提示文本
                          "count": res.total, //解析数据长度
                          "data": res.data.item //解析数据列表
                      };*!/
                },*/
                cols: [column],
            });
        }

    })
</script>